package de.lunaplayer.view.panels;

import java.util.Observable;
import java.util.Observer;

import javax.swing.*;

import de.lunaplayer.app.AppStarter;


@SuppressWarnings("serial")
public class RightPanel extends JPanel implements Observer{
	
	private JLabel playlistname;
	private JList list;
	private JScrollPane spane; 
	private JButton addPlaylist;
	private JButton delPlaylist;
	private JPanel panel;
	
	public RightPanel(){
		setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS));
		this.list = new JList();
		this.spane = new JScrollPane(list);
		this.panel = new JPanel();
		this.playlistname = new JLabel("Name der neuen Playlist");
		this.addPlaylist = new JButton(AppStarter.makeIcon("/resources/list-add.png"));
		this.delPlaylist = new JButton(AppStarter.makeIcon("/resources/list-remove.png"));
		buildPanel();
	}

	private void buildPanel() {
		this.list.setDragEnabled(true);
		this.list.setDropMode(DropMode.INSERT);
		add(spane);
		add(playlistname);
		this.panel.add(addPlaylist);
		this.panel.add(delPlaylist);
		add(panel);
		
	}

	@Override
	public void update(Observable arg0, Object arg1) {
		// TODO Observer implementieren
		
	}
	
	//TODO Aktuelle Playlist anzeigen
}
